
<!DOCTYPE html
  PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html lang="zh_cn">
   <head>
      <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
   
      <title>GM_registerMenuCommand [&#28145;&#20837;&#27973;&#20986; Greasemonkey]</title>
      <link rel="shortcut icon" href="/favicon.ico">
      <link rel="stylesheet" href="../css/dig.css" type="text/css">
      <meta http-equiv="Link" content='&lt;../css/modern.css&gt;; type="text/css"; rel=stylesheet, &lt;../css/empty.css&gt;; type="text/css";
      rel=stylesheet'>
      <link rev="made" href="mailto:mark@diveintomark.org">
      <meta name="generator" content="DocBook XSL Stylesheets V1.68.1">
      <meta name="keywords" content="Firefox, Greasemonkey, Javascript, user script, userscript">
      <link rel="start" href="../toc/index.html" title="&#28145;&#20837;&#27973;&#20986; Greasemonkey">
      <link rel="up" href="index.html" title="Greasemonkey API &#21442;&#32771;">
      <link rel="prev" href="gm_setvalue.html" title="GM_setValue">
      <link rel="next" href="gm_xmlhttprequest.html" title="GM_xmlhttpRequest">
   </head>
   <body id="diveintogreasemonkey-org" class="api-gmregistermenucommand">
      <div class="z" id="intro">
         <div class="sectionInner">
            <div class="sectionInner2">
               <div class="s">
                  <h1><a href="/" accesskey="1">&#28145;&#20837;&#27973;&#20986; Greasemonkey</a></h1>
                  <p>&#25945;&#32769;&#32593;&#32476;&#23398;&#26032;&#25226;&#25103;</p>
               </div>
               <div class="s">
                  <ul>
                     <li><a href="../">&#36215;&#22987;&#39029;</a> &middot; 
                     </li>
                     <li><a href="../toc/">&#30446;&#24405;</a> &middot; 
                     </li>
                     <li><a href="../download/">&#19979;&#36733;</a> &middot; 
                     </li>
                     <li><a href="http://greasemonkey.mozdev.org/">&#31435;&#21363;&#19979;&#36733; Greasemonkey</a></li>
                  </ul>
               </div>
            </div>
         </div>
      </div>
      <div id="main">
         <div id="mainInner">
            <p id="breadcrumb">&#24744;&#30340;&#20301;&#32622;&#65306;<a href="../">&#36215;&#22987;&#39029;</a> &#8594; <a href="../toc/index.html">&#30446;&#24405;</a> &#8594; <a href="index.html">Greasemonkey API &#21442;&#32771;</a> &#8594; <span class="thispage">GM_registerMenuCommand</span></p>
            <div class="refentry" lang="zh_cn"><a name="api.gmregistermenucommand" class="skip" href="#api.gmregistermenucommand" title="link to this refentry"><img src="../images/permalink.gif" alt="[link]" title="link to this refentry" width="8" height="9"></a> 
               <div class="titlepage"></div>
               <div class="refnamediv">
                  <h2>&#21517;&#31216;</h2>
                  <p>GM_registerMenuCommand &#8212; &#22312; <span><strong class="guisubmenu">&#29992;&#25143;&#33050;&#26412;&#21629;&#20196; (<span class="accel">C</span>)</strong></span> &#23376;&#33756;&#21333;&#20013;&#28155;&#21152;&#33756;&#21333;&#39033;
                  </p>
               </div>
               <div class="refsynopsisdiv">
                  <h2>&#22823;&#32434;</h2>
                  <div class="funcsynopsis"><pre class="funcsynopsisinfo"></pre><table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0">
                        <tr>
                           <td><code class="funcdef">function <b class="fsfunc">GM_registerMenuCommand</b>
                                 (</code></td>
                           <td>
                              &nbsp;
                           </td>
                           <td><var class="pdparam">commandName</var>
                              , 
                           </td>
                        </tr>
                        <tr>
                           <td>&nbsp;</td>
                           <td>
                              &nbsp;
                           </td>
                           <td><var class="pdparam">commandFunc</var>
                              , 
                           </td>
                        </tr>
                        <tr>
                           <td>&nbsp;</td>
                           <td>
                              &nbsp;
                           </td>
                           <td><var class="pdparam">accelKey</var>
                              , 
                           </td>
                        </tr>
                        <tr>
                           <td>&nbsp;</td>
                           <td>
                              &nbsp;
                           </td>
                           <td><var class="pdparam">accelModifiers</var>
                              , 
                           </td>
                        </tr>
                        <tr>
                           <td>&nbsp;</td>
                           <td>
                              &nbsp;
                           </td>
                           <td><var class="pdparam">accessKey</var>
                              <code>)</code>;
                           </td>
                        </tr>
                     </table>
                  </div>
               </div>
               <div class="refsection" lang="zh_cn"><a name="d0e5635" class="skip" href="#d0e5635" title="link to this refsection"><img src="../images/permalink.gif" alt="[link]" title="link to this refsection" width="8" height="9"></a> 
                  
                  <h2>&#25551;&#36848;</h2>
                  
                  <p>
                     <code class="function">GM_registerMenuCommand</code> &#22312; <span><strong class="guimenu">&#24037;&#20855; (<span class="accel">T</span>)</strong></span> &#8594; <span><strong class="guimenu"><span class="accel">G</span>reasemonkey</strong></span> &#8594; <span><strong class="guisubmenu">&#29992;&#25143;&#33050;&#26412;&#21629;&#20196; &#65288;<span class="accel">C</span>)</strong></span> &#23376;&#33756;&#21333;&#20013;&#28155;&#21152;&#33756;&#21333;&#39033;&#12290;<em class="parameter"><code>commandName</code></em> &#21442;&#25968;&#26159;&#19968;&#20010;&#23383;&#31526;&#20018;&#65292;&#26032;&#22686;&#30340;&#33756;&#21333;&#39033;&#30340;&#21517;&#31216;&#12290;<em class="parameter"><code>commandFunc</code></em> &#21442;&#25968;&#26159;&#20989;&#25968;&#23545;&#35937;&#12290;&#36873;&#20013;&#27492;&#33756;&#21333;&#39033;&#65292;<code class="function">commandFunc</code> &#20989;&#25968;&#23601;&#20250;&#34987;&#35843;&#29992;&#12290;<em class="parameter"><code>accelKey</code></em> &#21333;&#23383;&#31526;(&#20363;&#22914;&#65306;'g')&#25110;&#32773;&#38190;&#30424;&#30721;&#65292;&#29992;&#26469;&#35302;&#21457;&#21629;&#20196;&#12290;<em class="parameter"><code>accelKey</code></em> &#23383;&#31526;&#20018;&#65292;&#21015;&#20986;&#20102;&#24517;&#39035;&#19982; <em class="parameter"><code>accelKey</code></em> &#21516;&#26102;&#25353;&#19979;&#30340;&#20462;&#39280;&#38190;&#12290;&#22914;&#26524;&#22810;&#20110;&#19968;&#20010;&#21151;&#33021;&#38190;&#65292;&#29992;&#31354;&#26684;&#20998;&#24320;&#12290;&#20363;&#22914;&#65292;'shift' &#25110;&#32773; 'ctrl alt'&#12290;&#21487;&#29992;&#30340;&#21151;&#33021;&#38190;&#26377;&#65306;shift, alt, meta, control &#21644; accel&#12290;<em class="parameter"><code>accessKey</code></em>  &#21333;&#23383;&#31526;(&#20363;&#22914;&#65306;'g')&#24403;&#33756;&#21333;&#25171;&#24320;&#26102;&#29992;&#26469;&#36339;&#36716;&#21040;&#21629;&#20196;&#12290;&#23427;&#26368;&#22909;&#26159; <em class="parameter"><code>commandName</code></em> &#20013;&#30340;&#19968;&#20010;&#23383;&#27597;&#12290;
                  </p>
                  
                  <div class="funcsynopsis"><pre class="funcsynopsisinfo"></pre><p><code class="funcdef">function <b class="fsfunc">
                              callbackFunction
                              </b>
                           (</code>
                        <var class="pdparam">e</var>
                        <code>)</code>;
                     </p>
                  </div>
                  
                  <p>&#21442;&#25968; <em class="parameter"><code>e</code></em> &#26159;&#33756;&#21333;&#36873;&#25321;&#20107;&#20214;&#12290;&#25105;&#19981;&#30693;&#36947;&#36825;&#26377;&#20160;&#20040;&#29992;&#12290;
                  </p>
                  
               </div>
               <div class="refsection" lang="zh_cn"><a name="d0e5710" class="skip" href="#d0e5710" title="link to this refsection"><img src="../images/permalink.gif" alt="[link]" title="link to this refsection" width="8" height="9"></a> 
                  
                  <h2>&#21382;&#21490;</h2>
                  
                  <p>
                     <code class="function">GM_registerMenuCommand</code> &#30001; Greasemonkey 0.2.6 &#24341;&#20837;&#12290;
                  </p>
                  
               </div>
            </div>
            <div style="float: left">&#8592;&nbsp;<a class="NavigationArrow" href="gm_setvalue.html">GM_setValue</a></div>
            <div style="text-align: right"><a class="NavigationArrow" href="gm_xmlhttprequest.html">GM_xmlhttpRequest</a>&nbsp;&#8594;
            </div>
            <hr style="clear:both">
            <div class="footer">
               <p class="copyright">&#29256;&#26435; &copy; 2005 Mark Pilgrim &middot; <a title="&#21457;&#36865;&#32473;&#25105;&#26377;&#20110;&#27492;&#20070;&#30340;&#21453;&#39304;&#24847;&#35265;" href="mailto:mark@diveintomark.org">mark@diveintomark.org</a> &middot; <a href="../license/gpl.html" title="GNU &#36890;&#29992;&#20844;&#20849;&#35768;&#21487;&#35777;">&#20351;&#29992;&#26465;&#27454;</a></p>
            </div>
         </div>
      </div>
   </body>
</html>